#!/bin/sh -e

export CFLAGS="$CFLAGS -static"

for patch in bash50-0??; do
    patch -p0 < "$patch"
done

./configure \
    --prefix=/usr \
    --without-bash-malloc \
    --without-installed-readline \
    --disable-nls

make
make DESTDIR="$1" install

ln -s bash "$1/usr/bin/sh"
